#ifndef VDSMILESBTN_H
#define VDSMILESBTN_H

#include <QToolButton>

// qt
class QTableWidgetItem;
class QTableWidget;
class QWidgetAction;
class QModelIndex;

// my
class VDSmiles;
class VDSmile;

class VDSmilesBtn : public QToolButton
{
	Q_OBJECT

public:
	VDSmilesBtn(QWidget *parent);
	VDSmilesBtn(const VDSmiles *smiles, QWidget *parent);
	~VDSmilesBtn();

private:
	void init();

private:
	const VDSmiles *m_smiles;
	QTableWidget *m_tableWidget;
	QWidgetAction *m_widgetAction;
	QMenu *m_menu;

private slots:
	void slotClicked(const QModelIndex&);
	void slotItemClicked(QTableWidgetItem*);
	void slotItemSelectionChanged();

public slots:
	void setSmiles(const VDSmiles *smiles);

signals:
	void signalClickedSmile(const VDSmile&);
};

#endif // VDSMILESBTN_H
